package com.hstc.feign;


import com.hstc.feign.fallback.ProductFeignClientFallback;
import com.hstc.product.bean.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "service-product",fallback = ProductFeignClientFallback.class)//feign客户端
//contextId = "product-feignclient"
public interface ProductFeignClient {

    //发送请求
    @GetMapping("/product/{id}")
    Product getProductById(@PathVariable("id") Long id);
}
